<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<html>
<head>
    <meta charset="utf-8">
    <title>layui</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" th:href="@{Layuimini/lib/layui-v2.6.3/css/layui.css}" href="Layuimini/lib/layui-v2.6.3/css/layui.css" media="all">
    <link rel="stylesheet" th:href="@{Layuimini/css/public.css}" href="Layuimini/css/public.css" media="all">
    <style>
        body {
            background-color: #ffffff;
        }
    </style>
</head>
<body>
<div class="layui-form layuimini-form">
    <div class="layui-form-item">
        <label class="layui-form-label required">日志描述</label>
        <div class="layui-input-block">
            <input type="text" name="progress" lay-verify="required" lay-reqtext="日志描述不能为空"  value="" class="layui-input">
        </div>
    </div>



    <div class="layui-form-item layui-form-text">
        <label class="layui-form-label">日志详情描述</label>
        <div class="layui-input-block">
            <textarea name="problem" class="layui-textarea" ></textarea>
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">备注</label>
        <div class="layui-input-block">
            <input type="text" name="remark"    value="" class="layui-input">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">创建时间</label>
        <div class="layui-input-block">
            <input type="text" name="createTime"  class="layui-input" id="createTimeId">
        </div>
    </div>


    <div class="layui-form-item">
        <div class="layui-input-block">
            <button class="layui-btn layui-btn-normal" lay-submit lay-filter="saveBtn">确认保存</button>
        </div>
    </div>
</div>
<script  src="jQuery/jquery-2.1.1.min.js" th:src="@{LightYear/js/jquery.min.js}" charset="utf-8"></script>
<script th:src="@{Layuimini/lib/layui-v2.6.3/layui.js}" src="Layuimini/lib/layui-v2.6.3/layui.js" charset="utf-8"></script>
<script>
    layui.use(['form','table','laydate'], function () {
        var form = layui.form,
            layer = layui.layer,
            table = layui.table,
            laydate = layui.laydate;
        $ = layui.$;


        laydate.render({
            elem: '#createTimeId'//指定元素
            ,type: 'datetime'
            ,value:new Date()
        });

        //监听提交
        form.on('submit(saveBtn)', function (data) {
          //  console.log(data);
            this.disabled=true;//防止按钮重复提交
            //保存操作
            $.ajax({
                url:"superDevProgress/saveDevProgress",
                type:"POST",
                data:data.field,
                contentType: 'application/json; charset=UTF-8',
                async:false,
                dataType:'json',
                data:JSON.stringify(data.field),
                success:function(result){
                   // console.log(result);
                    layer.msg('添加成功！',{
                        time:2000
                    },function(){
                        window.parent.location.reload();  //刷新父页面
                    })
                }
            });


            return false;
        });

    });
</script>
</body>
</html>